#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main()
{
    int n = 0, m = 0;
    cin >> n >> m;
    string str;
    cin >> str;
    vector<string> v(m, "");
    for (int i = 0; i < m; i++)
    {
        cin >> v[i];
    }

    for (int i = 0; i < m; i++)
    {
        string s = v[i];
        string ans(n, 0);
        for (int j = 0; j < n; j++)
        {
            if (s[j] == '*')
            {
                ans[j] = str[j];
            }
            else
            {
                ans[j] = (str[j] == 'z' ? 'a' : str[j] + 1);
            }
        }
        cout << ans << endl;
    }

    return 0;
}